<template>
    <div>
        <div>
            <el-form ref="form" :model="find" label-width="80px">
                <el-form-item label="活动标签">
                    <el-input v-model="find.huod"></el-input>
                </el-form-item>
                <el-form-item label="作者">
                    <el-input v-model="find.marketName"></el-input>
                </el-form-item>
                <el-form-item label="活动详情">
                    <el-input
                            type="textarea"
                            :rows="2"
                            placeholder="请输入内容"
                            v-model="find.textarea">
                    </el-input>
                </el-form-item>
                <el-form-item>
                        <el-button type="primary"  @click="updateById(find)"
                        >确认</el-button
                        >
                </el-form-item>
            </el-form>

        </div>
    </div>
</template>

<script>
    export default {
        data(){
            return{
                find:[]
            }
        },
        created() {
            //查询我的基本信息
            this.findById();
        },
        methods: {
            findById(){
                this.$axios
                    .get("/systemuser/sHuodong/findById", {
                        params: {
                            //获取的周期
                            id1: this.$route.params.id,
                        },
                    })
                    .then((res) => {
                        this.find =  res.data;
                    });
            },
            updateById(find1){
                console.log(find1)
                // debugger
                this.$axios
                    .get("/systemuser/sHuodong/updateById", {
                        params: {
                            //获取的周期
                            id:this.find.announcementId1,
                            huod: this.find.huod,
                            textarea: this.find.textarea,
                            marketName: this.find.marketName,
                            qu:this.$route.params.id
                        },
                    })
                    .then((res) => {
                        if (res.data == true){
                            this.$router.push({
                                path: `/Activity`})
                        }
                    });
            }
        }
    }
</script>

<style scoped>

</style>
